Paul's JavaScript Examples    
 
Creating a scroll text in the 'browser Status' line

More of a piece of 'eyecandy' than really useful. But it can be handy to let your visitors know of 'newsflashes'. This script will turn the status line into a 'ticker' type scroller in which you can put your own message. As shown by the one used on this page.

Example

This script is automatically started when the page is loaded. Please check your browser's status line

Usage

<BODY onLoad="timerONE=window.setTimeout('scroller(100)',500)">

Source

<SCRIPT LANGUAGE="javascript">
<!--
function scroller(seed)
{
    var msg = " Welcome to Paul's JavaScript Examples.            Especially created for AWeb 3.1 buyers to help them make the most of this browser and give their pages a little extra functionality...    Feel free to visit http://www.iaehv.nl/users/paul/ and see what I have done with JavaScript"
    
    var out = " "
    var c   = 1

    if (seed > 100)  {
            seed--
            var cmd="scroller(" + seed + ")"
            ScrollTimer=window.setTimeout(cmd,100)
    }
    else if (seed <= 100 && seed > 0) {
            for (c=0;  c < seed;  c++)  {
                  out+=" "  
            }
            out+=msg
            seed--
            var cmd="scroller(" + seed + ")"
                window.status=out
            ScrollTimer=window.setTimeout(cmd,100)
    }
    else if (seed <= 0)  {
            if (-seed < msg.length) {
                     out+=msg.substring(-seed,msg.length)
                     seed--
                     var cmd="scroller(" + seed + ")"
                     window.status=out
                     ScrollTimer=window.setTimeout(cmd,100)
            }
            else {
                     window.status=" "
                     ScrollTimer=window.setTimeout("scroller(100)",75)
            }
        }
}
// -->
</SCRIPT>